package org.newdawn.yapgame.java2d;

import org.newdawn.yapgame.GameWindow;
import org.newdawn.yapgame.IResourceFactory;
import org.newdawn.yapgame.ISprite;

public class Java2DResourceFactory implements IResourceFactory
{
	protected Java2DGameWindow window = null;
	
	@Override
	public ISprite getSprite(String ref) 
	{
	    return Java2DSpriteStore.get().getSprite( window, ref );
	}

	@Override
	public GameWindow getGameWindow() 
	{
		if( this.window == null )
		{
			this.window = new Java2DGameWindow();
		}
		return this.window;
	}

}
